// Unresolved.cpp: implementation of the CUnresolved class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "8085.h"
#include "Unresolved.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
/*
CUnresolved::CUnresolved()
{
    m_Addressess.SetSize(10,10);
    m_Addressess.RemoveAll();
    m_szSymbol[0] = '\0';
}


CUnresolved::CUnresolved(char *str,word address)
{
    m_Addressess.SetSize(10,10);
    m_szSymbol[0] = '\0';
    Add(str,address);
}

CUnresolved::CUnresolved(const CUnresolved &c)
{
    //if(m_szSymbol!=NULL) delete [] m_szSymbol;
    if(c.m_szSymbol[0]!='\0')
    {
        strcpy(m_szSymbol,c.m_szSymbol);
        for(int i=0; i<c.m_Addressess.GetSize() ; i++)
            m_Addressess.Add(c.m_Addressess.GetAt(i));
    }
    else m_szSymbol[0] = '\0';
}


CUnresolved CUnresolved::operator =(CUnresolved &c)
{
    CUnresolved temp;
    strcpy(temp.m_szSymbol,c.m_szSymbol);

    for(int i=0; i<c.m_Addressess.GetSize() ; i++)
        temp.m_Addressess.Add(c.m_Addressess.GetAt(i));
    return temp;
}

CUnresolved::~CUnresolved()
{
    //if(m_szSymbol!=NULL) delete [] m_szSymbol;
}

void CUnresolved::Add(char *str,word address)
{
    strcpy(m_szSymbol,str);
    m_Addressess.Add(address);
}

int CUnresolved::GetAddressCount()
{
    return m_Addressess.GetSize();
}

int CUnresolved::GetAddressAt(int i)
{
    return m_Addressess.GetAt(i);
}

CUnresolved & CUnresolvedSymbol::GetAt(int i)
{
    return m_Unresolved.GetAt(i);
}

//////////////////////////////////////////////////////////////////////
// CUnresolvedSymbol Class
//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CUnresolvedSymbol::CUnresolvedSymbol()
{
    m_Unresolved.SetSize(25,10);
}

CUnresolvedSymbol::~CUnresolvedSymbol()
{

}

void CUnresolvedSymbol::Add(char *str,word address)
{
    for(int i=0; i<m_Unresolved.GetSize() ; i++)
    {
        if(strcmpi(str,m_Unresolved.GetAt(i).GetSymbol())==0)
        {
            // the symbol is already there, just add the address
            m_Unresolved.GetAt(i).Add(address);
            return;
        }
        CUnresolved c(str,address);
        m_Unresolved.Add(c);
    }
}


int CUnresolvedSymbol::GetSize()
{
    return m_Unresolved.GetSize();
}

*/